<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue生命周期</title>
    <!--通过如下方式引入 Vue-->
    <script src="https://unpkg.com/vue"></script>
</head>
<body>

</body>
<script type="text/javascript">
    var vm = new Vue({
        data:{
            a:1
        },
        beforeCreate:function () {
          console.log("--beforeCreate--, a is："+this.a);
        },
        created:function () {
            // `this` 指向 vm 实例
            console.log('--created--a is: ' + this.a);
        },
        beforeMount:function () {
            console.log('--beforeMount--a is: ' + this.a);
        },
        mounted:function () {
            console.log('--mounted--a is: ' + this.a);
        },
        beforeUpdate:function () {
            console.log('--beforeUpdate--a is: ' + this.a);
        },
        updated:function () {
            console.log('--updated--a is: ' + this.a);
        },
        activated:function () {
            console.log('--activated--a is: ' + this.a);
        },
        deactivated:function () {
            console.log('--deactivated--a is: ' + this.a);
        },
        beforeDestory:function () {
            console.log('--beforeDestory--a is: ' + this.a);
        },
        destoryed:function () {
            console.log('--destoryed-- ');
        }
    });
</script>
</html>
